

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=dark>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/my-blog/img/fluid.png">
  <link rel="icon" href="/my-blog/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="木舟">
  <meta name="keywords" content="python Vue Test 测试开发 自动化测试">
  
    <meta name="description" content="前言在介绍完css是如何工作，元素是如何显示到页面上的知识后，后面的章节包括这一章就要介绍关于布局方面的知识。 盒模型这个知识，在css中十分重要，可以这么说，你不知道盒模型是什么，你就没办法进行布局。 盒模型一般分为：  行盒，display: inline 块盒, display: block 行块盒, display: inline-block  为什么叫盒子呢？是因为，每个元素都会在页面中">
<meta property="og:type" content="article">
<meta property="og:title" content="盒模型">
<meta property="og:url" content="https://walker_kwu.gitee.io/my-blog/2022/09/15/notes/css/boxModel/">
<meta property="og:site_name" content="My Blog">
<meta property="og:description" content="前言在介绍完css是如何工作，元素是如何显示到页面上的知识后，后面的章节包括这一章就要介绍关于布局方面的知识。 盒模型这个知识，在css中十分重要，可以这么说，你不知道盒模型是什么，你就没办法进行布局。 盒模型一般分为：  行盒，display: inline 块盒, display: block 行块盒, display: inline-block  为什么叫盒子呢？是因为，每个元素都会在页面中">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-09-15T06:54:59.000Z">
<meta property="article:modified_time" content="2023-05-23T10:37:53.248Z">
<meta property="article:author" content="木舟">
<meta property="article:tag" content="测试开发">
<meta property="article:tag" content="测试平台">
<meta property="article:tag" content="css">
<meta name="twitter:card" content="summary_large_image">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>盒模型 - My Blog</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/my-blog/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/my-blog/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/my-blog/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"walker_kwu.gitee.io","root":"/my-blog/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/my-blog/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/my-blog/js/utils.js" ></script>
  <script  src="/my-blog/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/my-blog/">
      <strong>木舟</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my-blog/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my-blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my-blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my-blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/my-blog/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/my-blog/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="盒模型"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        木舟
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-09-15 14:54" pubdate>
          2022年9月15日 下午
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.2k 字
        
      </span>
    

    

    
    
      
        <span id="busuanzi_container_page_pv" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="busuanzi_value_page_pv"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">盒模型</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：2023年5月23日 晚上
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>在介绍完css是如何工作，元素是如何显示到页面上的知识后，后面的章节包括这一章就要介绍关于<strong>布局</strong>方面的知识。</p>
<p><strong>盒模型</strong>这个知识，在css中十分重要，可以这么说，你不知道盒模型是什么，你就没办法进行布局。</p>
<p>盒模型一般分为：</p>
<ul>
<li>行盒，display: inline</li>
<li>块盒, display: block</li>
<li>行块盒, display: inline-block</li>
</ul>
<p>为什么叫盒子呢？是因为，每个元素都会在页面中生成一个矩形区域，像一个盒子一样。</p>
<h2 id="常见的行盒-浏览器默认样式"><a href="#常见的行盒-浏览器默认样式" class="headerlink" title="常见的行盒(浏览器默认样式)"></a>常见的行盒(浏览器默认样式)</h2><ul>
<li>span</li>
<li>a</li>
<li>img</li>
</ul>
<h2 id="常见的块盒-浏览器默认样式"><a href="#常见的块盒-浏览器默认样式" class="headerlink" title="常见的块盒(浏览器默认样式)"></a>常见的块盒(浏览器默认样式)</h2><ul>
<li>h1~h6</li>
<li>p</li>
<li>div</li>
<li>ul</li>
</ul>
<p>本章最后会简单介绍一下<strong>display</strong>。</p>
<h1 id="盒子的组成部分"><a href="#盒子的组成部分" class="headerlink" title="盒子的组成部分"></a>盒子的组成部分</h1><p>无论是行盒、块盒、行块盒，组成一个盒子都会有四种必不可少的部分：</p>
<ul>
<li>margin，外边距</li>
<li>border，边框</li>
<li>padding，填充，也可以叫内边距</li>
<li>content，内容</li>
</ul>
<p>下面的介绍会基于<strong>块盒</strong>来介绍，因为<strong>行盒</strong>在行为上会有一些区别。</p>
<h2 id="content"><a href="#content" class="headerlink" title="content"></a>content</h2><p>盒子的内容，可以被width、height来定义宽高。</p>
<p>这个规则可以被一个css属性来改变：<strong>box-sizing</strong></p>
<p>内容部分，也叫做<strong>内容盒</strong></p>
<h2 id="padding"><a href="#padding" class="headerlink" title="padding"></a>padding</h2><p>定义盒子到边框之间的距离</p>
<p>内边距+内容 的区域 = 填充盒  <strong>padding-box</strong></p>
<p>有四个属性：</p>
<ul>
<li>padding-left</li>
<li>padding-right</li>
<li>padding-top</li>
<li>padding-bottom</li>
</ul>
<h3 id="有简写属性-padding"><a href="#有简写属性-padding" class="headerlink" title="有简写属性: padding"></a>有简写属性: <strong>padding</strong></h3><p>padding: 10px 12px 14px 16px</p>
<p>代表的是:</p>
<ul>
<li>padding-top: 10px</li>
<li>padding-right: 12px</li>
<li>padding-bottom: 14px</li>
<li>padding-left: 16px</li>
</ul>
<h3 id="更加简写的padding"><a href="#更加简写的padding" class="headerlink" title="更加简写的padding"></a>更加简写的padding</h3><p>padding: 10px 12px</p>
<p>代表的是:</p>
<ul>
<li>padding-top: 10px</li>
<li>padding-bottom: 10px</li>
<li>padding-right: 12px</li>
<li>padding-left: 12px</li>
</ul>
<h3 id="更更加简写的padding"><a href="#更更加简写的padding" class="headerlink" title="更更加简写的padding"></a>更更加简写的padding</h3><p>padding: 10px</p>
<p>代表的是:</p>
<ul>
<li>padding-top: 10px</li>
<li>padding-bottom: 10px</li>
<li>padding-right: 10px</li>
<li>padding-left: 10px</li>
</ul>
<h2 id="border"><a href="#border" class="headerlink" title="border"></a>border</h2><p>定义盒子的边框</p>
<p>边框+内边距+内容 的区域 = 边框盒 <strong>border-box</strong></p>
<p>border 有三个属性：</p>
<ul>
<li>border-width, 边框宽度</li>
<li>border-style, 边框样式，默认为none。为none时，不展示边框<ul>
<li>solid，实线，比较常用，常用做分割线</li>
<li>dashed，虚线</li>
</ul>
</li>
<li>border-color，边框颜色</li>
</ul>
<p>border有简写属性<strong>border</strong></p>
<p>border: 1px solid #DCDCDC</p>
<p>border 也可以单独指定方向来添加样式，比如：border-bottom</p>
<h2 id="外边距"><a href="#外边距" class="headerlink" title="外边距"></a>外边距</h2><p>定义与其他盒子之间的距离</p>
<p>属性有四个：</p>
<ul>
<li>margin-left</li>
<li>margin-right</li>
<li>margin-top</li>
<li>margin-bottom</li>
</ul>
<p>同样有简写属性: margin</p>
<p>书写方式与简写规则和<strong>padding</strong>一样。</p>
<h1 id="拓展：box-sizing"><a href="#拓展：box-sizing" class="headerlink" title="拓展：box-sizing"></a>拓展：box-sizing</h1><p>为什么要单独介绍<strong>box-sizing</strong>？</p>
<p>是因为这个属性，会在我们今后的开发过程中会运用到，运用原因也和我们的盒模型有关系。</p>
<p>上面我们说过，content的宽高由width、height来定义，我们来假设这样的一个场景。</p>
<blockquote>
<p>一个盒子你想要它占据面积为 100*100，但是同时，他要有2px的边框，你会怎么设计呢？</p>
</blockquote>
<p>是不是会这样？</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs css"><span class="hljs-selector-class">.test</span>&#123;<br>    <span class="hljs-attribute">width</span>: <span class="hljs-number">96px</span>;<br>    <span class="hljs-attribute">height</span>: <span class="hljs-number">96px</span>;<br>    <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#DCDCDC</span><br>&#125;<br></code></pre></td></tr></table></figure>

<blockquote>
<p>那如果这个时候需求变动了，要求：边框3px，占据面积为300*300，自己想想是不是很麻烦？还要自己计算。</p>
</blockquote>
<p>这个时候，就可以用上<strong>box-sizing</strong></p>
<p>这个属性作用为：规定宽高作用于哪个盒子，默认值为 <strong>内容盒 content-box</strong></p>
<p>我们只要把它设置成 <strong>box-sizing: border-box</strong> 就完事了。</p>
<p>接下来不管你需求怎么变动，我直接修改width、height、border就完事了，不需要再进行计算。</p>
<h1 id="行盒"><a href="#行盒" class="headerlink" title="行盒"></a>行盒</h1><p>行盒的特性：</p>
<ul>
<li>尺寸跟着内容走，内容越多，尺寸越大。</li>
<li>行盒不能设置宽高</li>
<li>两个行盒之间，是紧挨着不换行的。</li>
<li>进行内边距padding的调整，左右生效，垂直方向仅仅会影响背景，而不会实际占据空间。</li>
<li>进行边框border的调整，左右生效，垂直方向不会实际占据空间。</li>
<li>进行外边距margin的调整，左右生效，垂直方向不会实际占据空间。</li>
</ul>
<p>行盒的宽高，应该以下方式来设定通过：</p>
<ul>
<li>字体大小</li>
<li>行高</li>
</ul>
<p>这再一次说明了行盒的宽高是随着内容走的。</p>
<h1 id="行块盒"><a href="#行块盒" class="headerlink" title="行块盒"></a>行块盒</h1><p>只有一个特性和<strong>行盒</strong>一致，那就是：不换行，会和行盒、行块盒紧挨着</p>
<p>其他的都和<strong>块盒</strong>一致，那就是：尺寸类型的属性都可以生效</p>
<p>一般应用于<strong>分页器</strong></p>
<h2 id="空白折叠"><a href="#空白折叠" class="headerlink" title="空白折叠"></a>空白折叠</h2><p>空白折叠，发生在行盒（行块盒）内部 或 行盒（行块盒）之间，是由html的换行导致的。</p>
<p>解决方案：</p>
<ul>
<li>设置浮动，后续会有介绍</li>
<li>使用弹性布局，后续会有介绍</li>
<li>在html代码中，不进行换行</li>
</ul>
<h1 id="display"><a href="#display" class="headerlink" title="display"></a>display</h1><p>该元素十分重要，可以控制盒子的行为，除了上面介绍的三种属性值之外，常见的还有：</p>
<ul>
<li>display: flex  弹性布局，后续会有专门的章节进行介绍</li>
<li>display: none  不显示在网页上且不占据空间</li>
</ul>
<p>对应 <strong>display:none</strong> 还有一个属性可以起到网页中不显示的作用<strong>visibility: hidden</strong>，但是依然占据空间。</p>
<p><strong>visibility</strong>这个属性用的比较少，了解一下就可以了.</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/my-blog/categories/%E6%B5%8B%E8%AF%95%E5%BC%80%E5%8F%91/" class="category-chain-item">测试开发</a>
  
  
    <span>></span>
    
  <a href="/my-blog/categories/%E6%B5%8B%E8%AF%95%E5%BC%80%E5%8F%91/css/" class="category-chain-item">css</a>
  
  

  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/my-blog/tags/%E6%B5%8B%E8%AF%95%E5%BC%80%E5%8F%91/">#测试开发</a>
      
        <a href="/my-blog/tags/%E6%B5%8B%E8%AF%95%E5%B9%B3%E5%8F%B0/">#测试平台</a>
      
        <a href="/my-blog/tags/css/">#css</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>盒模型</div>
      <div>https://walker_kwu.gitee.io/my-blog/2022/09/15/notes/css/boxModel/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>木舟</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年9月15日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2023年5月23日</div>
        </div>
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
              <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
              <span class="hint--top hint--rounded" aria-label="NC - 非商业性使用">
                <i class="iconfont icon-nc"></i>
              </span>
              </a>
            
              <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
              <span class="hint--top hint--rounded" aria-label="SA - 相同方式共享">
                <i class="iconfont icon-sa"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/my-blog/2022/09/16/notes/css/layoutRule/" title="布局细则">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">布局细则</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/my-blog/2022/09/15/notes/css/computed/" title="属性计算过程">
                        <span class="hidden-mobile">属性计算过程</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <span>By 木舟</span> <i class="iconfont icon-love"></i> 
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="busuanzi_container_site_pv" style="display: none">
        总访问量 
        <span id="busuanzi_value_site_pv"></span>
         次
      </span>
    
    
      <span id="busuanzi_container_site_uv" style="display: none">
        总访客数 
        <span id="busuanzi_value_site_uv"></span>
         人
      </span>
    
    
  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/my-blog/js/events.js" ></script>
<script  src="/my-blog/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/my-blog/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/my-blog/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/my-blog/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
